package bakaLevel;

public class PlayerLevelModel {
	private BAKALevel mainInstance = BAKALevel.instance;
	private final String CONST_CONFIG_PRE_LEVEL_MULTIPLY = "LevelModel.MultiplyPreLevel";
	private final String CONST_CONFIG_FIRST_LEVEL_EXP = "LevelModel.FirstLevelExp";
	//Level start with 1
	private double PreLevelMultiply = 0.75f;
	//default set to 1.5
	public PlayerLevelModel() {
		mainInstance = BAKALevel.instance;
		PreLevelMultiply = mainInstance.getConfigInstance().getDouble(CONST_CONFIG_PRE_LEVEL_MULTIPLY);
	}

	public int FirstLevelExp()
	{
		return mainInstance.getConfigInstance().getInt(CONST_CONFIG_FIRST_LEVEL_EXP);
	}
	
	public int LevelRequireExp(int Level)
	{
		int intExp = FirstLevelExp();
		//pre level multiply
		
		for(int i = 2; i < Level; i++)
		{
			intExp *= PreLevelMultiply;
		}
		
		return intExp;
	}
} 
